//
//  IChingDef.h
//  Iching
//
//  Created by Leonardo Celati on 14/01/10.
//  Copyright 2010 Web & Zen Multimedia All rights reserved.
//

#import <UIKit/UIKit.h>

#define MAX_LAUNCH 6

//10.0f, 180.0f, 300.0f, 200.0f
// Toss view rect coordinates
#define TOSSVIEW_LEFT 10.0f
#define TOSSVIEW_TOP 180.0f
#define TOSSVIEW_WIDTH 300.0f
#define TOSSVIEW_HEIGHT 200.0f

//0.0f, 0.0f, 300.0f, 200.0f
// Toss view border 
#define TOSSVIEW_BORDER_LEFT 0.0f
#define TOSSVIEW_BORDER_TOP 0.0f
#define TOSSVIEW_BORDER_WIDTH 300.0f
#define TOSSVIEW_BORDER_HEIGHT 200.0f

#define TOSSVIEW_BORDER_STROKE 0.5

// yin coordinates
//CGContextAddRect(context, CGRectMake(60.0, 150.0 - (pos*20), 80.0, 10.0));
//CGContextAddRect(context, CGRectMake(170.0, 150.0 - (pos*20), 80.0, 10.0));
#define YIN_LLEFT 60.0f
#define YIN_LTOP 150.0f
#define YIN_LWIDTH 80.0f
#define YIN_LHEIGHT 10.0f

#define YIN_RLEFT 170.0f
#define YIN_RTOP 150.0f
#define YIN_RWIDTH 80.0f
#define YIN_RHEIGHT 10.0f

//CGContextAddRect(context, CGRectMake(60.0, 150.0 - (pos*20), 190.0, 10.0));
#define YANG_LEFT 60.0f
#define YANG_TOP 150.0f
#define YANG_WIDTH 190.0f
#define YANG_HEIGHT 10.0f

#define LINE_MULTIPLIER 20

/**
 * identifying a coin
 */
typedef enum {
	head=3,
	tail=2
} Coin;

/**
 identify a line, three coins with a side value of
 2 and 3 can result in 6,7,8,9
 */
typedef enum {
	yinMutable=tail+tail+tail,	// 6 --> 7
	yang=tail+tail+head,		// 7 
	yin=head+head+tail,			// 8
	yangMutable=head+head+head	// 9 --> 8
} Line;

/**
 The structure of hexagram from bottom "start" to top "end"
 */
typedef struct {
	Line start;
	Line officer;
	Line transit;
	Line minister;
	Line lord;
	Line end;
} Hexagram;



